//
//  UIView+Extesnion.swift
//  微博01
//
//  Created by 牛威 on 15/12/7.
//  Copyright © 2015年 牛威. All rights reserved.
//

import UIKit


extension UIView {
    
    
    
    var width : CGFloat {
    
    
        get {
            
            return self.frame.width
            
        }
        
        set {
            
         
            var frame = self.frame
            
            frame.size.width = newValue
            
            self.frame = frame
            
        }
  
    
    }
    
    var height : CGFloat {
    
        get {
        
        return self.frame.height
        
        
        }
    
        set {
        
        
          var frame = self.frame
            
          frame.size.height = newValue
            
          self.frame = frame
        
        }
    
    }
    
    var x :CGFloat {
    
        get {
        
        return self.frame.origin.x
        
        }
        
        set {
        
          var frame = self.frame
            
          frame.origin.x = newValue
            
          self.frame = frame
        
        
        }
    
    
    }
    
    var y :CGFloat {
        
        get {
            
            return self.frame.origin.y
            
        }
        
        set {
            
            var frame = self.frame
            
            frame.origin.y = newValue
            
            self.frame = frame
            
            
        }
        
        
    }
    
    var size : CGSize {
    
        get {
        
          return self.frame.size
        
        }
        
        set {
        
          var frame = self.frame
            
            frame.size = newValue
            
            self.frame = frame
        
        }
    
    
    }

    
    //中心x
    
    var centerX : CGFloat {
    
        get {
        
         return self.center.x
        
        }
        
        set {
        
        var center = self.center
            
            center.x = newValue
            
            self.center = center
            
            
        
        
        }
    
    
    }
    
    //中心y
    
    var centerY : CGFloat {
        
        get {
            
            return self.center.y
            
        }
        
        set {
            
            var center = self.center
            
            center.y = newValue
            
            self.center = center
            
            
            
            
        }
        
        
    }
    

    


    



}
